﻿@using loveMotorcade.web.Classes;
@model object
@{
    Layout = null;
    
    Type t = Model.GetType();
    var action = t.GetProperty("action") == null ? Html.getRoute(routeKeyEnum.action) : t.GetProperty("action").GetValue(Model, null);
    var controller = t.GetProperty("controller") == null ? Html.getRoute(routeKeyEnum.controller) : t.GetProperty("controller").GetValue(Model, null);
    var id = t.GetProperty("id") == null ? Html.getRoute(routeKeyEnum.id) : t.GetProperty("id").GetValue(Model, null);
    var routeName = Html.getRoute(routeKeyEnum.area) == null ? "paging" : Html.getRoute(routeKeyEnum.area) + "_paging";
    }

@if (ViewBag.paging!=null && ViewBag.paging.Count != 3)
    {
       
<div class="paging" id="paging_Footer">
@if (ViewBag.paging != null)                                                                                                            
{
    foreach (var item in ViewBag.paging)
    {
        if (item.isLink)
        {
            <span>@Html.RouteLink((string)item.linkText, routeName, new { action = action, controller = controller, id = id, page = item.pageNum })</span>
        }
        else
        {
            if (item.isSelected)
            {
                <span class="select">@item.linkText</span>
            }
            else
            {
                <span>@item.linkText</span>
            }
        }

    }
}
</div>
    }